package yqt.com.cnki.dao.impl;

import cnki.tpi.kbatis.sqlsession.SqlSession;
import cnki.tpi.kbatis.utils.DataSourceUtil;
import org.springframework.stereotype.Repository;
import yqt.com.cnki.bo.ZSFWBo;
import yqt.com.cnki.dao.IZSFWDao;
import yqt.com.cnki.po.ZSFWPo;

import java.util.List;

/**
 * Description:
 *
 * @author BaiGe
 * @date: 2021/11/11 15:58
 * @Version 1.0
 */
@Repository
public class ZSFWDaoImpl implements IZSFWDao {
    @Override
    public List<ZSFWPo> getZSFWByTableName_LimitFive(ZSFWPo zsfwPo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "yqt.com.cnki.dao.IZSFWDao.getZSFWByTableName_LimitFive";
        return sqlSession.selectList(statementId, zsfwPo,false);
    }

    @Override
    public List<ZSFWPo> getCNKIResource_LimitFive(ZSFWBo zsfwBo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "yqt.com.cnki.dao.IZSFWDao.getCNKIResource_LimitFive";
        return sqlSession.selectList(statementId,zsfwBo,false);
    }

    @Override
    public List<ZSFWPo> getCNKIResource_List(ZSFWBo zsfwBo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "yqt.com.cnki.dao.IZSFWDao.getCNKIResource_List";
        return sqlSession.selectList(statementId,zsfwBo,false);
    }

    @Override
    public long getCNKIResource_Count(ZSFWBo zsfwBo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "yqt.com.cnki.dao.IZSFWDao.getCNKIResource_Count";
        return sqlSession.getCount(statementId,zsfwBo);
    }

    @Override
    public List<ZSFWPo> getCNKIResourceIndex(ZSFWBo zsfwBo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "yqt.com.cnki.dao.IZSFWDao.getCNKIResourceIndex";
        return sqlSession.selectOne(statementId,zsfwBo,false);
    }
}
